// store/chatStore.ts
import { defineStore } from "pinia";

interface ChatMessage {
  id?: number;
  role: string;
  content: string;
}

export const useChatStore = defineStore("chat", {
  state: () => ({
    messages: [] as ChatMessage[],
  }),
  actions: {
    addMessage(message: ChatMessage) {
      this.messages.push(message);
    },
    clearMessages() {
      this.messages = [];
    },
  },
});
